<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>鑫立方管理系统</title>
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/common.css" />
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/main.css" />
<script type="text/javascript" src="<%=basePath%>js/libs/modernizr.min.js"></script>
<script type="text/javascript" src="<%=basePath%>js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="<%=basePath%>My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
	
	/* $(function(){
	
	
		  $.ajax({
             type: "GET",
             url: "/product/showPage",
             //data: {username:$("#username").val(), content:$("#content").val()},
             dataType: "json",
             success: function(data){
             
             alert(data);
                  /*        $('#resText').empty();   //清空resText里面的所有内容
                         var html = ''; 
                         $.each(data, function(commentIndex, comment){
                               html += '<div class="comment"><h6>' + comment['username']
                                         + ':</h6><p class="para"' + comment['content']
                                         + '</p></div>';
                         });
                         $('#resText').html(html); */
                      }
         });
	
	
	
	}) */
   
</script>
</head>
<body>
  <div class="topbar-wrap white">
    <div class="topbar-inner clearfix">
      <div class="topbar-logo-wrap clearfix">
        <ul class="navbar-list clearfix">
          <li><a class="on" href="#">鑫立方管理系统</a>
          </li>
        </ul>
      </div>
      <div class="top-info-wrap">
        <ul class="top-info-list clearfix">
          <li><a href="/user/logout">退出</a>
          </li>
        </ul>
      </div>
    </div>
  </div>
  <div class="container clearfix">
    <div class="sidebar-wrap">
      <div class="sidebar-content">
        <ul class="sidebar-list">
          <li><a href="#"><i class="icon-font">&#xe003;</i>厂家</a>
            <ul class="sub-menu">
           
            
             <li><a href="<%=basePath + "factory/search"%>"><i class="icon-font">&#xe006;</i>商品管理</a>
              </li>
              
              <li><a href="<%=basePath + "factory/ordersearch"%>"><i class="icon-font">&#xe006;</i>订单确认</a>
              </li>
            </ul></li>

        </ul>
      </div>
    </div>
    <!--/sidebar-->
    <div class="main-wrap">

      <div class="crumb-wrap">
        <div class="crumb-list">
          <i class="icon-font"></i><a href="/factory/index">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">订单管理</span>
        </div>
      </div>
      <div class="search-wrap">
        <div class="search-content">
          <form action="/factory/ordersearch" method="post">
            <table class="search-tab">
              <tr>
                <th width="70">订单编号:</th>
                <td><input class="common-text" placeholder="例如：201503220001" name="o_id" value="${o_id }" id="" type="text"></td>

                <th width="70">订单时间:</th>
                <td><input class="common-text" name="createTime" type="text" onClick="WdatePicker()" placeholder="请点击选择时间"
                  value="<fmt:formatDate value="${createTime }" pattern="yyyy-MM-dd" />" /></td>
                
                <!--  
                <th width="120">订单状态:</th>
                <td><select name="courseType" id="">
                    <c:if test="${empty courseType || courseType == '-1'}">
                      <option value="-1" selected="selected">全部</option>
                      <option value="0">待确认</option>
                      <option value="1">已确认</option>
                    </c:if>
                    <c:if test="${courseType == '0' }">
                      <option value="-1">全部</option>
                      <option value="0" selected="selected">待确认</option>
                      <option value="1">已确认</option>
                    </c:if>
                    <c:if test="${courseType == '1' }">
                      <option value="-1">全部</option>
                      <option value="0">待确认</option>
                      <option value="1" selected="selected">已确认</option>
                    </c:if>
                </select>
                </td>
                -->
                
                <td><input class="btn btn-primary btn2" name="sub" value="查询" type="submit"></td>
              </tr>
            </table>
          </form>
        </div>
      </div>
      <div class="result-wrap">
        <form name="myform" id="myform" method="post">
          <div class="result-content">
            <table class="result-tab" width="100%">
              <tr>

                <th>序号</th>
                <th>订单编号</th>
                <th>客户信息</th>
                <th>送货地址</th>
                <th>创建时间</th>
                <!--  
                <th>订单状态</th>
                -->
                <th>操作</th>
              </tr>
              <c:forEach items="${pageRecord.list }" var="o" varStatus="s">
                <tr>
                  <td>${s.index + 1}</td>
                  <td>${o.o_id}</td>
                  <td>${o.custerName }</td>
                  <td>${o.custerAddress}</td>
                  <td><fmt:formatDate value="${o.createTime }" type="date"/></td>
                  <!--  
                  <td><c:if test="${o.status == 0 }">待确认</c:if> <c:if test="${o.status == 1 }">已确认</c:if></td>
                  -->
                  <td><a href="/factory/orderconfirm?o_id=${o.o_id }" >查看订单</a>
                  </td>

                </tr>
              </c:forEach>
            </table>

          <div class="list-page">
            
            <fmt:parseNumber var="totalPageNumber" value="${pageRecord.totalPage }" type="number"></fmt:parseNumber>
            <span style="float: right"> <c:if test="totalPageNumber > 5">
                <c:set var="totalPageNumber" value="5"></c:set>
              </c:if> <c:if test="totalPageNumber <= 5">
                <c:set var="totalPageNumber" value="${pageRecord.totalPage }"></c:set>
              </c:if> <c:forEach var="item" varStatus="status" begin="1" end="${totalPageNumber }">
                  <a href="index?page=${status.index }">${status.index }</a>
              </c:forEach>
            </span>
            <span> 共 ${pageRecord.totalRow } 条 ${pageRecord.pageNumber }/${pageRecord.totalPage } 页 </span>
          </div>
          </div>
        </form>
      </div>
    </div>
    <!--/main-->
  </div>
</body>
</html>
